{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<form class="layui-form p-4">
	<h3 class="pb-3">新建</h3>
	<table class="layui-table layui-table-form">
		<!-- <tr><td class="layui-td-gray-2">商品名称<font>*</font></td>
			<td><input type="text" name="name"  lay-verify="required" lay-reqText="请完善商品名称" value="" autocomplete="off" placeholder="请输入商品名称" class="layui-input"></td><td class="layui-td-gray-2">县区</td>
			<td><input type="text" name="region"  value="" autocomplete="off" placeholder="请输入县区" class="layui-input"></td><td class="layui-td-gray-2">规格</td>
			<td><input type="text" name="specification"  value="" autocomplete="off" placeholder="请输入规格" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">生产日期</td>
			<td><input type="text" name="produced_time"  value="" autocomplete="off" placeholder="请输入生产日期" class="layui-input"></td><td class="layui-td-gray-2">配送日期</td>
			<td><input type="text" name="delivery_time"  value="" autocomplete="off" placeholder="请输入配送日期" class="layui-input"></td><td class="layui-td-gray-2">分拣量（下单）</td>
			<td><input type="text" name="sorting"  value="" autocomplete="off" placeholder="请输入分拣量（下单）" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">分拣合计</td>
			<td><input type="text" name="sorting_total"  value="" autocomplete="off" placeholder="请输入分拣合计" class="layui-input"></td><td class="layui-td-gray-2">出库数</td>
			<td><input type="text" name="out_storage"  value="" autocomplete="off" placeholder="请输入出库数" class="layui-input"></td><td class="layui-td-gray-2">入库数</td>
			<td><input type="text" name="in_storage"  value="" autocomplete="off" placeholder="请输入入库数" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">损耗</td>
			<td><input type="text" name="wastage"  value="" autocomplete="off" placeholder="请输入损耗" class="layui-input"></td><td class="layui-td-gray-2">备注</td>
			<td><input type="text" name="remark"  value="" autocomplete="off" placeholder="请输入备注" class="layui-input"></td><td class="layui-td-gray-2">创建时间</td>
			<td><input type="text" name="create_time"  value="" autocomplete="off" placeholder="请输入创建时间" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">分拣员</td>
			<td><input type="text" name="sorting_admin"  value="" autocomplete="off" placeholder="请输入分拣员" class="layui-input"></td><td class="layui-td-gray-2">创建人</td>
			<td><input type="text" name="create_admin"  value="" autocomplete="off" placeholder="请输入创建人" class="layui-input"></td><td class="layui-td-gray-2">配送人</td>
			<td><input type="text" name="delivery_admin"  value="" autocomplete="off" placeholder="请输入配送人" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">温馨提示</td>
			<td><input type="text" name="tip"  value="" autocomplete="off" placeholder="请输入温馨提示" class="layui-input"></td><td class="layui-td-gray-2">采购方</td>
			<td><input type="text" name="purchaser"  value="" autocomplete="off" placeholder="请输入采购方" class="layui-input"></td><td class="layui-td-gray-2">订单号</td>
			<td><input type="text" name="order_no"  value="" autocomplete="off" placeholder="请输入订单号" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">状态</td>
			<td><input type="text" name="status"  value="" autocomplete="off" placeholder="请输入状态" class="layui-input"></td><td colspan='4'></td>
		</tr> -->
		<tr><td class="layui-td-gray-2">县区</td>
			<td>
				
				<select name="region"  lay-reqText="请选择县区" lay-search="">
					
					{volist name=":get_region()" id="v"}
					<option value="{$v.id}">{$v.nianji} </option>
					{/volist}
				</select>
			</td>
			<td class="layui-td-gray-2">商品名称<font>*</font></td>
			<td><input type="text" name="name"  lay-verify="required" lay-reqText="请完善商品名称" value="" autocomplete="off" placeholder="请输入商品名称" class="layui-input"></td>
			
			<td class="layui-td-gray-2">规格</td>
			<td><input type="text" name="specification"  value="" autocomplete="off" placeholder="请输入规格" class="layui-input"></td>
		</tr>
				<tr>
					<td class="layui-td-gray-2">采购商</td>
			<td>
				<select name="purchaser"  lay-reqText="请选择采购商" lay-search="">
					
					{volist name=":get_purchaser()" id="v"}
					<option value="{$v.id}" >{$v.name} </option>
					{/volist}
				</select>
			</td>
					<td class="layui-td-gray-2">生产日期</td>
			<td>
				<input type="text" name="produced_time"  value="" readonly id="laydate_produced_time" autocomplete="off" placeholder="请选择生产日期" class="layui-input">
			</td><td class="layui-td-gray-2">配送日期</td>
			<td><input type="text" name="delivery_time"  value="" readonly id="laydate_delivery_time" autocomplete="off" placeholder="请输入配送日期" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">订单号</td>
			<td><input type="text" name="order_no"  value="" autocomplete="off" placeholder="请输入订单号" class="layui-input"></td><td class="layui-td-gray-2">出库数</td>
			<td><input type="text" name="out_storage"  value="" autocomplete="off" placeholder="请输入出库数" class="layui-input"></td><td class="layui-td-gray-2">入库数</td>
			<td><input type="text" name="in_storage"  value="" autocomplete="off" placeholder="请输入入库数" class="layui-input"></td>
		</tr>
				<tr><td class="layui-td-gray-2">分拣量</td>
			<td><input type="text" name="sorting"  value="" autocomplete="off" placeholder="请输入分拣量（下单）" class="layui-input"></td><td class="layui-td-gray-2">备注</td>
			<td><input type="text" name="remark"  value="" autocomplete="off" placeholder="请输入备注" class="layui-input"></td>
			<td class="layui-td-gray-2">状态</td>
			<td><input type="text" name="status"  value="" autocomplete="off" placeholder="请输入状态" class="layui-input"></td><td colspan='4'></td>
		</tr>
		<tr>
			<td></td>
		</tr>
				<tr><td class="layui-td-gray-2">分拣员1</td>
			<td><!-- <input type="text" name="sorting_admin"  value="" autocomplete="off" placeholder="请输入分拣员" class="layui-input"> -->
				<select name="sorting_admin"  lay-reqText="请选择分拣员" lay-search="">
					<option value="0" >--请选择分拣员-- </option>
					{volist name=":get_fenjian()" id="v"}
					<option value="{$v.id}">{$v.name} </option>
					{/volist}
				</select>
			</td>
			<td class="layui-td-gray-2">分拣员2</td>
			<td><!-- <input type="text" name="sorting_admin"  value="" autocomplete="off" placeholder="请输入分拣员" class="layui-input"> -->
				<select name="sorting_admin2"  lay-reqText="请选择分拣员" lay-search="">
					<option value="0" >--请选择分拣员-- </option>
					{volist name=":get_fenjian()" id="v"}
					<option value="{$v.id}">{$v.name} </option>
					{/volist}
				</select>
			</td>

			<td class="layui-td-gray-2">配送人</td>
			<td><input type="text" name="delivery_admin"  value="" autocomplete="off" placeholder="请输入配送人" class="layui-input"></td>

		</tr>
				<tr><td class="layui-td-gray-2">温馨提示</td>
			<td colspan="3"><input type="text" name="tip"  value="" autocomplete="off" placeholder="请输入温馨提示" class="layui-input"></td>

			
		</tr>
				<tr>
		</tr>
	</table>
	<div class="pt-3">
		<input type="hidden" name="id" value="0"/>
		<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
		<button type="reset" class="layui-btn layui-btn-primary">重置</button>
	</div>
</form>
{/block}
<!-- /主体 -->

<!-- 脚本 -->
{block name="script"}
<script>
	var moduleInit = ['tool'];

	function gouguInit() {
		var form = layui.form, tool = layui.tool;
		layui.laydate.render({
			elem: '#laydate_produced_time' //指定元素delivery_time
			//,type:'date'
		});
		layui.laydate.render({
			elem: '#laydate_delivery_time' //指定元素
			//,type:'date'
		});
		
				
		//监听提交
		form.on('submit(webform)', function (data) {
			
			let callback = function (e) {
				layer.msg(e.msg);
				if (e.code == 0) {
					tool.sideClose(1000);
				}
			}
			tool.post("/admin/order/add", data.field, callback);
			return false;
		});
	}
</script>
{/block}
<!-- /脚本 -->